@extends('admin.layout')

@section('title', $title)

@section('content')
		
	
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                公告管理
                <small>公告列表</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
                <li><a href="#">公告管理</a></li>
                <li class="active">公告列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">查看公告</h3>
                        </div><!-- /.box-header -->

                    <div class='box-body'>
                        <form action="{{ url('admin/notice/index') }}" >
                            <div class='col-md-3 col-md-offset-9' style="padding-top:10px;">
                                <div class="input-group input-group-sm" >
                                    <input value="{{ $request['keywords'] or '' }}" name='keywords' class="form-control" type="text" >
                                    <span class="input-group-btn">
                                        <button class="btn btn-info btn-flat">搜索</button>
                                    </span>
                                </div>
                            </div>  
                        </form>
                    </div>
                             @if (session('info'))
                                <div id='error'>                        
                                    <div class="alert alert-danger">         
                                            <p>{{ session('info') }}</p>                                 
                                    </div>
                                </div>
                            @endif
                        <div class="box-body">
                            <table id="example2" class="table table-bordered table-hover" style="table-layout:fixed;">
                                <thead>
                                <tr>
                                	<th>编号</th>
                                    <th>公告标题</th>
                                    <th>公告时间</th>
                                    <th>公告内容</th>
                                    <th>公告状态</th>
                                    <th>操作</th>

                                </tr>
                                </thead>
                                <tbody>
                               @foreach ($data as $v)
                                <tr>
                                    <td>{{ $v -> id }}</td>
                                    <td> {{ $v -> title }}</td>
                                    <td > {{ date('Y-m-d H:i:s', $v -> time ) }}</td>
                                    <td style="overflow:hidden; white-space:nowrap; text-overflow:clip;">  {!! $v -> content !!}</td>
                                    <td>
                                    @if($v -> status == 0)
                                    	<p class='mouse'> 不显示</p>
                                  	@elseif($v -> status == 1)
                                  		<p class='mouse'> 显示</p>
                                    @endif
                                    </td>
                                    <td class='mouse'><a href="{{ url('admin/notice/edit') }}/{{ $v -> id }}"> 编辑</a> <a href="{{ url('admin/notice/delete') }}/{{ $v -> id }}">删除</a></td>


                                </tr>
                         	@endforeach
                                </tbody>
                            </table>
                        {!! $data -> appends($request) -> render() !!}
                          
                        </div><!-- /.box-body -->
                        
                    </div><!-- /.box -->

                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div><!-- /.content-wrapper -->
    <script type="text/javascript">

    window.onload = function()
    {

		//修改鼠标形状
    	$('.mouse').css('cursor', 'pointer');

		 setInterval(function()
                {
                    $('#error').fadeOut(1000);
                },3000)

	}

    </script>

@endsection